Imports System.Data.SqlClient

Friend Class DBServer_Info
    Inherits DBBase

    Public Function ServerName(Optional ByVal sConnection As String = "") As String
        Dim sResult As String = ""

        Dim sSQL As String = "select @@servername"

        Dim sSC As String = MyBase.msConnectionString
        If sConnection > "" Then sSC = sConnection

        Dim oObject As Object = MyBase.ExecuteScalar(sSQL, sConnection)
        If Not oObject Is Nothing Then
            sResult = CStr(oObject)
        End If

        Return sResult
    End Function

    Public Function DatabaseName(Optional ByVal sConnection As String = "") As String
        Dim sResult As String = ""

        Dim sSQL As String = "select db_name()"

        Dim sSC As String = MyBase.msConnectionString
        If sConnection > "" Then sSC = sConnection

        Dim oObject As Object = MyBase.ExecuteScalar(sSQL, sConnection)
        If Not oObject Is Nothing Then
            sResult = CStr(oObject)
        End If

        Return sResult
    End Function
End Class
